package com.robot.controllers;

import com.robot.models.EventInfo;
import com.robot.services.EventInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by renruiquan on 2017/5/27.
 */
@RestController
@RequestMapping("/eventInfo")
public class EventInfoController {

    @Autowired
    private EventInfoService eventInfoService;

    @RequestMapping(value = "/")
    public String Index() {
        return "Hello World";
    }

    @RequestMapping(value = "/getAllList")
    public List<EventInfo> getAllList() {
        return eventInfoService.getAllList();
    }

    @RequestMapping(value = "/add")
    public int add(EventInfo eventInfo) {
        return eventInfoService.add(eventInfo);
    }
}
